View Javadoc
1 package jrre.gui; 2 3 import java.awt.*; 4 import java.awt.event.*; 5 import javax.swing.*; 6 7 public class Console extends JFrame implements ActionListener{ 8 9 private static String controlPanelButtonNames[] = {"Constan Pool","Heap","Method Area","Empty"}; 10 private Script textScript; 11 private ControlPanel controlPanel; 12 13 public Console(){ 14 setTitle("Java Research Runtime Enviroment Console"); 15 getContentPane().setBackground(Color.blue); 16 setVisible(true); 17 setSize(800,600); 18 addWindowListener(new WindowDestroyer()); 19 setupGUI(); 20 pack(); 21 } 22 23 private void setupGUI(){ 24 getContentPane().setLayout(new GraphPaperLayout(new Dimension(6,6))); 25 textScript = new Script(350,250); 26 getContentPane().add(textScript,new Rectangle(2,0,4,4)); 27 controlPanel = new ControlPanel(300,300,2,5,controlPanelButtonNames,this); 28 controlPanel.setBackgroundColor(new Color(171,96,75)); 29 getContentPane().add(controlPanel,new Rectangle(0,0,2,2)); 30 } 31 32 public void reportMessage(String s){ 33 textScript.appendMessage(s); 34 } 35 36 public void actionPerformed(ActionEvent e){} 37 38 39 public static void main(String args[]){ 40 Console c = new Console(); 41 c.reportMessage("Yo"); 42 c.reportMessage("Dude"); 43 } 44 45 46 class WindowDestroyer extends WindowAdapter{ 47 public void windowClosing(WindowEvent e){ 48 System.exit(0); 49 } 50 } 51 52 }

This page was automatically generated by Maven